<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .done{
            width: 100px;
            height: 100px;
            background-color: salmon;
        }
    </style>
</head>
<body>
    
    <div id="app">
        <button @click="show">点我出现</button>

        <div class="done" v-show="flag"></div>
        <br>
        <input type="button" v-on:click="sum" value="点我" />
        <input type="text" v-model="num1"> + 
        <input type="text" v-model="num2"> = 
        <input type="text" :value="count"> 

        <button @click="fn($event)">事件对象</button>
    </div>

    <script src="../lib/Vue/vue.js"></script>
    <script>

        var vm = new Vue({
            el: '#app',
            data: {
                flag: false,
                num1: '',
                num2: '',
                count: '',
            },
            methods: {
                show() {
                    this.flag = !this.flag
                },
                sum() {
                    this.count = Number(this.num1) + Number(this.num2)
                },
                fn(e) {
                    console.log(e);
                }
            }
        })
    </script>
</body>
</html>